module.exports = {
    port: 8800,
    IPv4: 'localhost',
    // agentSev: 'http://192.168.2.13:8800',
    agentSev: 'http://api.17find.com',
    // agentSev: 'http://192.168.2.216:8080',
    // agentWx: 'https://api.weixin.qq.com',
    // agentSevJxt: 'http://sxt.17find.com',
    getAgent: function() {
        return {
            '/app/*': {
                target: this.agentSev
            },
            '/teacherapp/*': {
                target: this.agentSev
            },
            '/thirdparty/*': {
                target: this.agentSev
            },
            '/cgi-bin/*': {
                target: this.agentWx
            },
            '/appH5/*': {
                target: this.agentSev
            },
            '/operationapp/*': {
                target: this.agentSev
            },
            '/media/*': {
                target: this.agentSev
            }
            // '/jxt-commonbackground/*': {
            //     target: this.agentSevJxt
            // }
        }
    },
    getIP: function() {
        try {
            const network = require('os').networkInterfaces()
            this.IPv4 = network[Object.keys(network)[0]][1].address
        } catch (e) {
            this.IPv4 = '127.0.0.1';
        } finally {
            const httpStr = 'http://' + this.IPv4 + ':' + this.port;
            const opn = require('opn');
            console.log(httpStr);
            setTimeout(function() {
                //opn(httpStr);
            }, 20000);
            return this.IPv4;
        }
    }
}
